package com.yuncommunity.runcircle.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.yuncommunity.runcircle.R;
import com.yuncommunity.runcircle.base.MyFragment;
import com.yuncommunity.runcircle.conf.JsonApi;
import com.yuncommunity.runcircle.conf.Net;
import com.yuncommunity.runcircle.list.HistoryList;

/**
 * Created by oldfeel on 11/22/15.
 */
public class HistoryFragment extends MyFragment {
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.history, container, false);
        return view;
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        getChildFragmentManager().beginTransaction().replace(R.id.history_list, HistoryList.newInstance(getNet())).commit();
    }

    private Net getNet() {
        Net net = new Net(getActivity(), JsonApi.getSportDataList);
        return net;
    }

}
